library(survey)
library(dplyr)
library(ggplot2)
library(gridExtra)
library(haven)
library(ggplot2)

# Figure 8.6
df.mtf <- read_dta("C:/Users/Robert Allred/Documents/Duke/Civ_Mil_Appendix/Data/MTF_Aggregate.dta")
df.ds <- read_dta("C:/Users/Robert Allred/Documents/Duke/Civ_Mil_Appendix/Data/Defense_Spending.dta")


# Line plot without points
ggplot(data=df.ds, aes(x=year))+
  geom_line(aes(y=defensespendingistoolow, linetype="DEFENSE SPENDING IS TOO LOW"),
            size=1.0)+
  geom_line(aes(y=greatdealofconfidenceinmilitary, linetype="GREAT DEAL OF CONFIDENCE IN MILITARY"),
            size=1.0)+
  scale_y_continuous(limits=c(0,0.51))+
  scale_x_continuous(limits=c(1969,2021))+
  scale_linetype_manual(breaks=c("DEFENSE SPENDING IS TOO LOW",
                                 "GREAT DEAL OF CONFIDENCE IN MILITARY"),
                        values = c(1,2))+
  xlab("\nYear")+
  ylab("Percentage of Respondents\n")+
  theme(panel.grid = element_blank(), panel.background = element_blank(),
        panel.border = element_rect(fill=NA),
        text = element_text(size=16), legend.position = "bottom", 
        legend.title = element_blank())
